package com.girant.logger.entity.vo.form;

import com.girant.web.annotation.DateFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;

//日常日志Excel导出（出参）
@Data
public class LogFormExportVO {

    //服务名称
    @Schema(description = "服务名称代码 使用字典key做查询条件：sysLogServerName", nullable = true)
    private String serverName;

    //客户端类型
    @Schema(description = "客户端类型（value：01 PC 02 APP）", nullable = true)
    private String clientType;

    //访问源IP
    @Schema(description = "访问源IP", nullable = true)
    private String sourceIp;

    //内容分类
    @Schema(description = "内容分类", nullable = true)
    private String category;

    //关键字查询
    @Schema(description = "关键字查询，匹配标题、内容、操作人昵称、浏览器、浏览器版本、堆栈信息", nullable = true)
    @Size(max = 100, message = "关键字长度不能超过100字符")
    private String keyword;

    //分布式追踪ID
    @Schema(description = "分布式追踪ID",  nullable = true)
    private String traceId;

    // 分布式跨度ID
    @Schema(description = "分布式跨度ID", nullable = true)
    private String spanId;

    //日志级别
    @Schema(description = "日志级别，取值：ERROR WARN INFO DEBUG TRACE", nullable = true)
    private String logLevel;

    // 操作开始时间字符串
    @Schema(description = "操作开始时间（包含，格式：yyyy-MM-dd HH:mm）",  nullable = true,requiredMode = Schema.RequiredMode.REQUIRED)
    private String operationStartTime;

    // 操作结束时间字符串
    @Schema(description = "操作结束时间（包含，格式：yyyy-MM-dd HH:mm）", nullable = true,requiredMode = Schema.RequiredMode.REQUIRED)
    private String operationEndTime;

    @Schema(hidden = true)
    @DateFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime operationStartTimeLd;

    //后端转换用：操作结束时间（LocalDateTime类型)
    @Schema(hidden = true)
    @DateFormat(pattern = "yyyy-MM-dd HH:mm",second = 59)
    private LocalDateTime operationEndTimeLd;
}
